module ProjectsHelper
  
  def text_if_referer(first, second, includes)
    referer = @request.env["HTTP_REFERER"]
    (referer && referer.include?(includes)) ? second : first;
  end
  
  def notes(project)
  	notes = project.notes.count;
    msg = case notes
      when 0
      	"nenhuma nota";
      when 1
      	"uma nota";
      else
      	"#{notes} notas";
    end
    msg.titlecase;
  end
  
end